<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        #box{
            width: 200px;
            height: 200px;
            background: pink;
        }
    </style>
</head>
<body>
    <!--  
        1. 鼠标事件
            onclick         单击
            ondblclick       双击
            oncontextmenu   右击
            onmouseover     划入
            onmouserout     划出
            onmousedown     按下
            onmouseup       松开
            onmousemove     移动
    -->
    <div id="box"></div>
    <script>
        var box = document.getElementById('box');
        // 单击
        box.onclick = function(){
            this.innerHTML = '单击';
        }
        box.ondblclick = function(){
            this.innerHTML = '双击';
        }
        // 移动
        box.onmousemove = function(){
            // 随机 0~255
            var r = Math.round(Math.random() * 255);
            var g = Math.round(Math.random() * 255);
            var b = Math.round(Math.random() * 255);
            this.style.backgroundColor = `rgb(${r},${g},${b})`;
        }
    </script>
</body>
</html>